home *** CD-ROM | disk | FTP | other *** search
-
-
-
- TestBits(V37) TestBits(V37)
-
-
- FFOORRMMAATT
- TTEESSTTBBIITTSS [NNAAMMEE] _f_i_l_e|_d_i_r_e_c_t_o_r_y [FFLLAAGGSS] _f_l_a_g_s
-
- TTEEMMPPLLAATTEE
- NNAAMMEE//AA,,FFLLAAGGSS//AA
-
- PPUURRPPOOSSEE
- To test whether one or more protection flags are set.
-
- SSPPEECCIIFFIICCAATTIIOONN
- TTEESSTTBBIITTSS is used to to test the state of one or more of
- the protection bits. This can be useful in scripts. The
- protection bits are represented by letters:
- rr The file can be read.
- ww The file can be written to.
- ee The file is an executable program.
- dd The file can be deleted.
- ss The file is a script.
- pp The file can be made resident.
- aa The file has been archived.
- If a letter is preceded by a `-', it means that in order
- to match, the corresponding file bit must _n_o_t be set.
- Whitespace is not allowed between the letters representing
- the bits. If the state of all the bits given in the _f_l_a_g_s
- argument match the file's protection bits, TTEESSTTBBIITTSS sets
- the condition flag to 5 (WARN), otherwise it is set to 0.
- To check the response, an IIFF statement can be used.
-
- EEXXAAMMPPLLEE
- The following script will test whether or not its argument
- is a script:
- .KEY myfile/A
- TESTBITS <myfile> s
- IF WARN
- ECHO <myfile> is a script
- ELSE
- ECHO <myfile> is not a script
- ENDIF
-
- SSEEEE AALLSSOO
- FFIINNDD(V37), IIFF(AmigaDOS), PPRROOTTEECCTT(AmigaDOS)
-
- AAUUTTHHOORR
- Torsten Poulin (torsten@diku.dk)
-
- UUNNRREESSTTRRIICCTTIIOONNSS
- TTEESSTTBBIITTSS is free; anyone may redistribute copies of TTEESSTT
- BBIITTSS to anyone under the terms stated in the GNU General
- Public Licence, a copy of which accompanies each copy of
- TTEESSTTBBIITTSS.
-
- Torsten Poulin encourages you to improve and extend TTEESSTT
- BBIITTSS, and urges that you contribute your extensions to the
- world.
-
-
-
- TestBits version 37.1 11 March 1993 1
-
-
-